// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init({
  env: 'cloud1-2gn53z0t5a838e4c', //填上你的云开发环境id
  traceUser: true,
})
let db = cloud.database()
// 云函数入口函数
exports.main = async (event, context) => {

  return await db.collection('userData').add({
    data:{
      userId: '111111',
      date: event.date,
      oil: event.oil,
      sugar:  event.sugar,
      salt: event.salt,
      isIodizedSalt: false,
      Iodine: event.Iodine,
      IodineSalt: event.IodineSalt,
      comment: event.comment
    }
  });
}